package com.demo.demo.dao;

import com.demo.demo.bean.Warehouse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

@Mapper
public interface WarehouseDao {
    // 获取当前商品库存信息
    Warehouse getWarehouseByProductName(String productName);

    // 更新库存数量
    void updateWarehouseQuantity(Warehouse warehouse);

    // 插入新商品到仓库
    void insertNewProduct(Warehouse warehouse);

    // 获取所有仓库地址（去重）
    List<String> getWarehouseLocations();

    // 根据仓库地址查询商品信息
    List<Warehouse> getProductsByLocation(String location);
    List<Warehouse> findPagedByVarietyAndLocation(
    @Param("varietyType") String varietyType,
    @Param("location") String location,
    @Param("pageStart") int pageStart,
    @Param("pageSize") int pageSize
);

    int countByVarietyAndLocation(
            @Param("varietyType") String varietyType,
            @Param("location") String location);


}

